﻿<UserControl x:Class="LightingPlatform.View.UserManager.UserManagerView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:LightingPlatform.View.UserManager"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit">
    <UserControl.Resources>
        <local:RoleTypeConverter x:Key="RoleTypeConverter"/>
    </UserControl.Resources>
    <toolkit:BusyIndicator   Name="busy"  BusyContent="正在加载用户信息，请稍等......">
        <Grid x:Name="LayoutRoot" Margin="20,20,0,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="40"></RowDefinition>
                <RowDefinition Height="*"></RowDefinition>
            </Grid.RowDefinitions>
            <Button Width="95" Height="23" x:Name="AddUserBtn" VerticalAlignment="Center" HorizontalAlignment="Left">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
                    <Image Source="Images/Add.png" Width="14" Height="14" VerticalAlignment="Center"/>
                    <TextBlock Text="新增用户" Margin="5,0,0,0" VerticalAlignment="Center"/>
                </StackPanel>
            </Button>
            <sdk:DataGrid AutoGenerateColumns="False" Grid.Row="1" HorizontalAlignment="Left" Name="dataGrid1" VerticalAlignment="Stretch"  IsReadOnly="True">
                <sdk:DataGrid.Columns>
                    <sdk:DataGridTextColumn Width="100" Header="用户" Binding="{Binding Name}"/>
                    <sdk:DataGridTextColumn  Width="100" Header="角色" Binding="{Binding RoleType, Converter={StaticResource RoleTypeConverter}}"/>
                    <sdk:DataGridTemplateColumn Header="用户操作" Width="100">
                        <sdk:DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
                                    <Button  Click="Modify_Click" Style="{StaticResource TransparentButton}">
                                        <Image Source="/LightingPlatform;component/Images/modify.png" Stretch="None" Width="16" Height="16" ></Image>
                                    </Button>
                                    <Button  Click="Delete_Click" Style="{StaticResource TransparentButton}" Margin="10, 0, 0, 0">
                                        <Image Source="/LightingPlatform;component/Images/del.png" Stretch="None"  Width="16" Height="16"></Image>
                                    </Button>
                                </StackPanel>
                            </DataTemplate>
                        </sdk:DataGridTemplateColumn.CellTemplate>
                    </sdk:DataGridTemplateColumn>
                </sdk:DataGrid.Columns>
            </sdk:DataGrid>
        </Grid>
    </toolkit:BusyIndicator>
</UserControl>
